package com.teach.shape2;

import java.util.Scanner;

/**
 * 正方形
 * @author J.L.Zhou
 *	jlzhou.top 版权所有
 */
public class Square extends Rectangle {

	public Square(){
		name="正方形";
	}

	public void input(Scanner sc) {
		System.out.println("输入"+name+"的边长: ");
		float width = sc.nextFloat();
		setWidth(width);
		setHeight(width);
	}

	@Override
	public String getInputInfo() {
		return String.format("边长：%.2f",getWidth());
	}

}
